<include file="Public:header" />
<script type="text/javascript">
    function checknode(obj)
    {
        var chk = $("input[type='checkbox']");
        var count = chk.length;
        var num = chk.index(obj);
        var level_top = level_bottom =  chk.eq(num).attr('level');
        for (var i=num; i>=0; i--)
        {
            var le = chk.eq(i).attr('level');
            if(eval(le) < eval(level_top))
            {
                chk.eq(i).attr("checked",true);
                var level_top = level_top-1;
            }
        }
        for (var j=num+1; j<count; j++)
        {
            var le = chk.eq(j).attr('level');
            if(chk.eq(num).attr("checked")==true) {
                if(eval(le) > eval(level_bottom)) chk.eq(j).attr("checked",true);
                else if(eval(le) == eval(level_bottom)) break;
            }
            else {
                if(eval(le) > eval(level_bottom)) chk.eq(j).attr("checked",false);
                else if(eval(le) == eval(level_bottom)) break;
            }
        }
    }
</script>
<div class="table-list" id="load_priv">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
                <th class="text-l cu-span" style='padding-left:30px;'><span onClick="javascript:$('input[name=menuid[]]').attr('checked', true)">全选</span>/<span onClick="javascript:$('input[name=menuid[]]').attr('checked', false)">取消</span></th>
            </tr>
        </thead>
    </table>
    <form name="myform" action="__SELF__" method="post">
        <input type="hidden" name="id" value="{$row.id}"></input>
        <input type="hidden" name="doclose" id="doclose" value="0">
        <table width="100%" cellspacing="0" id="dnd-example">
            <tbody>
                {$menus}
            </tbody>
        </table>
        <div class="btn"><input type="submit" class="dialog" name="dosubmit" id="dosubmit" value="提交" /></div>
    </form>
</div>
</body>
</html>